
package org.darcy.entity.business;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.darcy.entity.CheckDelivery;
import org.darcy.entity.CheckPlan;
import org.darcy.entity.CheckReason;
import org.darcy.entity.work.WorkFlowObject;
import org.darcy.entity.work.WorkInstance;
import org.darcy.vo.ContractAmount;
import org.darcy.vo.project.FlowInfo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

@Schema(description = "BusinessContract: 合同")
@TableName(value = "business_contract")
@Getter
@Setter
public class BusinessContract extends WorkFlowObject implements Serializable {

	private static final long serialVersionUID = 1L;

	@Schema(description = "表单编号")
	@TableField(value = "`form_no`")
	private String formNo;

	@Schema(description = "委托单位id")
	@TableField(value = "`client_id`")
	private Integer clientId;

	@Schema(description = "我方单位id")
	@TableField(value = "`company_id`")
	private Integer companyId;

	@Schema(description = "合同开始时间")
	@TableField(value = "`contract_begin`")
	private Date contractBegin;

	@Schema(description = "合同结束时间")
	@TableField(value = "`contract_end`")
	private Date contractEnd;

	@Schema(description = "归档时间or终止时间")
	@TableField(value = "`contract_archive`")
	private Date contractArchive;

	@Schema(description = "项目状态，0：进行中；1：完成；-1：终止")
	@TableField(value = "`project_status`")
	private Integer projectStatus;

	@Schema(description = "线上合同")
	@TableField(value = "`online_contract`")
	private Integer onlineContract;

	@Schema(description = "合同金额")
	@TableField(value = "`contract_amount`")
	private String contractAmount;

	@Schema(description = "派工到账比例")
	@TableField(value = "`contract_ratio`")
	private String contractRatio;

	@Schema(description = "委托依据")
	@TableField(value = "`check_reason`")
	private Integer checkReason;

	@Schema(description = "采样计划")
	@TableField(value = "`check_plan`")
	private Integer checkPlan;

	@Schema(description = "附件")
	@TableField(value = "`file`")
	private String file;

	@Schema(description = "委托性质")
	@TableField(value = "`project_type`")
	private String projectType;

	@Schema(description = "联系人")
	@TableField(value = "`client_manager`")
	private String clientManager;

	@Schema(description = "地址")
	@TableField(value = "`client_address`")
	private String clientAddress;

	@Schema(description = "预计完成时间")
	@TableField(value = "`finish_time`")
	private Date finishTime;

	@Schema(description = "项目经办人")
	@TableField(value = "`project_operator`")
	private Integer projectOperator;

	@Schema(description = "项目负责人")
	@TableField(value = "`project_manager`")
	private Integer projectManager;

	@Schema(description = "合同完整性")
	@TableField(value = "`is_complete`")
	private Integer isComplete;

	@Schema(description = "盖章合同是否已递交财务室")
	@TableField(value = "`is_deliver`")
	private Integer isDeliver;

	@Schema(description = "合同登记备注")
	@TableField(value = "`remark1`")
	private String remark1;

	@Schema(description = "合同确认备注")
	@TableField(value = "`remark2`")
	private String remark2;

	@Schema(description = "盖章合同")
	@TableField(value = "`formal_file`")
	private String formalFile;

	@Schema(description = "创建时间")
	@TableField(value = "`create_time`")
	private Date createTime;

	@Schema(description = "更新时间")
	@TableField(value = "`update_time`")
	private Date updateTime;

	@Schema(description = "删除标识0：删除；1：存在")
	@TableField(value = "`del_flag`")
	private Integer delFlag;

	// 扩展属性

	@Schema(description = "委托业务列表")
	@TableField(exist = false)
	private List<String> projectTypeList;

	@Schema(description = "项目经办人姓名")
	@TableField(exist = false)
	private String projectOperatorName;

	@Schema(description = "委托单位")
	@TableField(exist = false)
	private String clientName;

	@Schema(description = "我方单位")
	@TableField(exist = false)
	private String companyName;

	// @Schema(description = "采样计划")
	@TableField(exist = false)
	private CheckPlan plan;

	@Schema(description = "检测依据")
	@TableField(exist = false)
	private CheckReason reason;

	@Schema(description = "线上合同，单个")
	@TableField(exist = false)
	private List<String> onlineContractList;

	@Schema(description = "附件列表")
	@TableField(exist = false)
	private List<String> fileList;

	@Schema(description = "合同确认附件列表")
	@TableField(exist = false)
	private List<String> confirmFileList;

	@Schema(description = "合同收款附件列表")
	@TableField(exist = false)
	private List<String> payFileList;

	@Schema(description = "客户开票资料")
	@TableField(exist = false)
	private BankInfo bankInfo;

	@Schema(description = "收款列表")
	@TableField(exist = false)
	private List<BusinessFinancialReceived> receiveList;

	@Schema(description = "开票列表")
	@TableField(exist = false)
	private List<BusinessFinancialBill> billList;

	@Schema(description = "派工单列表")
	@TableField(exist = false)
	private List<CheckDelivery> deliveryList;

	@Schema(description = "合同总金额")
	@TableField(exist = false)
	private Float contractAmountTotal;

	@Schema(description = "合同金额列表")
	@TableField(exist = false)
	private List<ContractAmount> contractAmountList;

	@Schema(description = "收款总金额")
	@TableField(exist = false)
	private Float receivedAmountTotal;

	@Schema(description = "收款金额列表")
	@TableField(exist = false)
	private List<ContractAmount> receivedAmountList;

	@Schema(description = "开票总金额")
	@TableField(exist = false)
	private Float billAmountTotal;

	@Schema(description = "工作项列表")
	@TableField(exist = false)
	private List<WorkInstance> workList;

	@Schema(description = "流程所处环节")
	@TableField(exist = false)
	private int index;

	@Schema(description = "流程环节信息")
	@TableField(exist = false)
	private FlowInfo[] flowInfoList;

}
